using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Editor
{
    public class MinimizeSideMenuBar : MenuItem
    {
        public MinimizeSideMenuBar(MapArea mapArea, Texture2D spriteImage, Vector2 position) : base(mapArea, spriteImage, position) { }

        public override void ClickAction()
        {
            if (base.mapArea.SideMenu.IsMinimized)
            {
                base.mapArea.SideMenu.IsMaxamizing = true;
                base.mapArea.SideMenu.IsMinimized = false;
            }
            else if (!base.mapArea.SideMenu.IsMinimized)
            {
                base.mapArea.SideMenu.IsMinimizing = true;
                base.mapArea.SideMenu.IsMinimized = true;
            }
        }

        public new void Draw(SpriteBatch spriteBatch)
        {
            SpriteEffects flip = SpriteEffects.None;
            if (base.mapArea.SideMenu.IsMinimizing || base.mapArea.SideMenu.IsMinimized)
            {
                flip = SpriteEffects.FlipHorizontally;
            }
            spriteBatch.Draw(base.ItemSprite, new Rectangle((int)base.vPosition.X, (int)base.vPosition.Y, base.ItemSprite.Width, base.mapArea.SideMenu.Height), null, Color.White, 0.0f, Vector2.Zero, flip, 0.0f);
        }
    }
}
